<script setup>
const emit = defineEmits(['getMessage'])
const sendMsg = ()=>{
    emit('getMessage', 'this is son msg')
}

</script>
<template>
<div class="test">
  <button @click="sendMsg">点我</button>
</div>
</template>
<style scoped>
.test {
    width: 300px;
    height: 200px;
    border: 1px solid black;
}
</style>